﻿#ifndef TOPTITLE_H
#define TOPTITLE_H

#include <QString>
#include <QPushButton>
#include <QLabel>
#include <QFrame>

class TopTitle : public QFrame
{
    Q_OBJECT
public:
    TopTitle(QWidget* parent = nullptr);
    virtual ~TopTitle() {}
    void setTitleInfo(const QString strTitle);
private slots:
    void slt_expand();
    void slt_closeWindow();
    void slt_resizeWindow();
    void slt_showTabs();

signals:
    void click_expand();
    void click_closeWindow();
    void click_resizeWindow();
    void click_showTabs();

protected:
    void mousePressEvent(QMouseEvent* event) override;
    void mouseMoveEvent(QMouseEvent* event) override;
    void mouseDoubleClickEvent(QMouseEvent* event) override;

private:
    bool m_bWindowNormal;
    QPushButton* m_pResizeWindow;
    QLabel* m_pTitleInfo;
    QPoint m_lastPos;
};

#endif
